package com.zty.schedule.api;

import com.zty.schedule.entity.Plan;
import com.zty.schedule.service.PlanService;
import org.springframework.beans.factory.annotation.Autowired;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Test {
    public static void main(String[] strs){
        /*SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        Date now = new Date();
        String time2 = format.format(now);
        String time=format.format("2020-11-15");
        System.out.println();
        System.out.println(time2);
        2020年10月01日-2023年9月30日*/
/*
        long Days = 0;
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

        try {
            long time = sdf.parse("2020-10-01").getTime();
            long time1 = sdf.parse("2023-09-30").getTime();
            Days = (int) ((time1 -time) /(24 * 60 * 60 * 1000));
            System.out.println(Days);
        } catch (ParseException e) {
            e.printStackTrace();
        }*/

        String mobiles="13034058373";
        boolean flag = false;
        try{
            Pattern p = Pattern.compile("^1[0-9]{10}$");
            Matcher m = p.matcher(mobiles);
            System.out.println(m);
            flag = m.matches();
            System.out.println(flag);
        }catch(Exception e){

        }
    }

}
